
@attached(member, names: named(logger))
public macro LSLog(
    subsystem: String? = nil,
    category: String? = nil
) = #externalMacro(module: "LSLoggerMacros", type: "LSLoggerMacro")


import OSLog
public struct LSLogger {
    public init(subsystem: String = Bundle.main.bundleIdentifier ?? "", category: String) {
        self.logger = Logger(subsystem: subsystem, category: category)
    }
    
    private let logger: Logger
    
    public func log(_ message: String) {
        logger.log("\(message)")
    }
    
    public func log(level: OSLogType, _ message: String) {
        logger.log(level: level, "\(message)")
    }
    
    public func trace(_ message: String) {
        logger.trace("\(message)")
    }
    
    public func debug(_ message: String) {
        logger.debug("\(message)")
    }

    public func info(_ message: String) {
        logger.info("\(message)")
    }

    public func notice(_ message: String) {
        logger.notice("\(message)")
    }

    public func warning(_ message: String) {
        logger.warning("\(message)")
    }

    public func error(_ message: String) {
        logger.error("\(message)")
    }

    public func critical(_ message: String) {
        logger.critical("\(message)")
    }

    public func fault(_ message: String) {
        logger.fault("\(message)")
    }
}
